'use strict';
/* 创建的迁移文件  node_modules\.bin\sequelize migration:create --name userAddAge
  用来给user表添加删除age字段
*/
module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add altering commands here.
     *
     * Example:
     * await queryInterface.createTable('users', { id: Sequelize.INTEGER });
     */
    // 添加age字段
    await queryInterface.addColumn('Users', 'age', {
      type: Sequelize.TINYINT,
      allowNull: false,
      defaultValue: 0
    })
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add reverting commands here.
     *
     * Example:
     * await queryInterface.dropTable('users');
     */
    // 删除age字段
    await queryInterface.removeColumn('Users', 'age')
  }
};
